<template>
    <section id="edit-class">
        <c-title :hide="false" text='商品分类'></c-title>
        <section class="box">
            <ul class="name">
                <li ><i class="iconfont icon-info-must"></i>分类名称</li>
                <li ><input type="text" placeholder="请输入分类名称" v-model="classify_name"></li>
            </ul>
            <!-- <ul class="class-img">
                <li><i class="iconfont icon-info-must"></i>分类图片</li>
                <div class="load-img">
                    <el-upload :action="uploadUrl" :on-preview="handlePreview" :limit="1" list-type="picture-card" :show-file-list="false" :on-exceed="handleExceed" :before-upload="beforeUpload" :on-success="handleStoreSuccess">
								<img v-if="imageUrl" :src="imageUrl" class="avatar">
								<i v-else class="iconfont icon-photobzhaoxiang"></i>
					</el-upload>
                </div>
            </ul> -->
            <!-- <ul class="recommend">
                <li><i class="iconfont icon-info-must"></i>是否推荐</li>
                <li>
                    <el-radio-group v-model="isRecommend">
                        <el-radio label="是"></el-radio>
                        <el-radio label="否"></el-radio>
                    </el-radio-group>
                </li>
            </ul> -->
            <ul class="recommend">
                <li ><i class="iconfont icon-info-must"></i>是否开启</li>
                <van-switch v-model="isOpen" active-value="1" inactive-value="0" size="15px" active-color='#F15353' inactive-color="#D6D6DC" />
            </ul>
            <ul class="recommend">
              <li>排序：</li>
              <li><input type="text"  placeholder="请输入序号" v-model.number="display_order"></li>
            </ul>
          </section>
          <section id="bottom"  :class="{'opacity-6':!classify_name}" :style="{width:(this.fun.getPhoneEnv() == 3?'375px':'100%')}">
              <button type="button" @click="sureEdit">确认编辑</button>
          </section>
    </section>
</template>

<script>
import firstEdit from './first_edit_controller.js';
export default firstEdit;
</script>

<style lang="scss" rel="stylesheet/scss" scoped>
  .opacity-6{
    opacity: .6;
  }
.avatar {
  width: 100%;
  height: 100%;
}
.recommend{
    margin-top:1.0938rem;
  }

#edit-class {
  .box {
    background-color: #fff;
    border-radius: 0.625rem;
    margin: 0.75rem;
    padding: 1.25rem 0.75rem;
    .name,
    .recommend {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 16px;


      i {
        font-size: 12px;
        color: #f15353;
        position: relative;
        top: -5px;
      }

      input {
        border: none;
        text-align: right;
        font-size: 0.875rem;
      }

      li:first-child {
        width: 6.875rem;
        text-align: left;
      }
    }

    .class-img {
      text-align: left;
      font-size: 16px;
      padding: 0 0.875rem 0.625rem 0.875rem;
      border-bottom: solid 0.0625rem #ebebeb;

      li {
        height: 2.75rem;
        line-height: 2.75rem;
      }
      // .load-img{
      //     width:6.25rem;
      //     height:6.25rem;
      //     display: flex;
      //     justify-content: center;
      // }
      .icon-info-must {
        font-size: 12px;
        color: #f15353;
        margin-right: 0.375rem;
      }

      .icon-photobzhaoxiang {
        line-height: 5rem;
        font-size: 24px;
        color: #c9c9c9;
      }
    }


  }
}
#bottom {
      border-top: solid 0.0625rem #ebebeb;
      width: 100%;
      position: fixed;
      bottom: 0;
      background-color: #fff;
      padding: 0 0.875rem;
      font-size: 16px;

      button {
        color: #fff;
      width: 100%;
      height: 2.5rem;
      line-height: 2.5rem;
      background-color: #f15353;
      border-radius: 1.2813rem;
      border: none;
      margin: 0.375rem 0;
      }
    }
</style>